package com.focus.xyz.other.cases;

import com.alibaba.fastjson.JSONObject;
import com.focus.xyz.core.utils.HttpClientUtil;
import org.testng.Assert;
import org.testng.annotations.Test;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by chenmeng on 2016/6/3.
 */
public class TestFlightInter {

    @Test(invocationCount = 1,threadPoolSize = 1,enabled = true)
    public void test() throws Exception{
        Map paras = new HashMap<String,String>();
        paras.put("fid","MU2888");
        String response = HttpClientUtil.sendPostRequest("http://localhost/api/flight",paras);
        System.out.println(response);
        JSONObject o = JSONObject.parseObject(response);
        if(o.containsKey("message")){
            String m = (String) o.get("message");
            Assert.assertEquals(m,"success");
        }
    }

    @Test(invocationCount = 1,threadPoolSize = 1,enabled = true)
    public void test01() throws Exception{
        Map paras = new HashMap<String,String>();
        paras.put("fid","MU2851");
        String response = HttpClientUtil.sendPostRequest("http://localhost/api/flight",paras);
        System.out.println(response);
        JSONObject o = JSONObject.parseObject(response);
        if(o.containsKey("message")){
            String m = (String) o.get("message");
            Assert.assertEquals(m,"success");
        }
    }
}
